<?php
session_start( );
?>
<?
if (!isset($_SESSION['verifyUser'])) {
header("location: main.php");
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><!--DVID=00001DE9-->
<HTML>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<LINK href="frmm.css" rel="stylesheet" type="text/css">
<title>慕主先鋒教會</title>
</head>
<?php
$regid=  $_SESSION['regid'];
$rid=  $_SESSION['rid'];
$myemail =  $_SESSION['email'];
$pastor=   $_SESSION['pastor'];
$fullname= $_SESSION['fullname']; 
$user_level = $_SESSION['verifyUser'];
$expire =$_SESSION['expire'];
?>
<body link=#3060c0 vlink=#3060c0>

<?php include ("con_getreg.php"); ?>
<div id="container"> 
  <h1><img src="frmmtitlePic.jpg" width="785" height="75"></h1>
  <div id="thin-col">
登入名(Login as)<br><li>
<?php
if ($expire >=0) {?>
<a href="con_registrant.php"><?php echo $_SESSION['fullname']; ?></a>
<?php
} else { echo $_SESSION['fullname']; }?>
<p>

<a href=logout.php>登出(Logout)</a>
<hr color=#c0c0c0 size = 1>

特會報名<br>(Registration for)</b><li><?php echo $_SESSION['conferenceID']; ?>
<?php 
  require_once('connections/mysqlDB.php');
  $dbConn = new mysqli(HOST,USER,PWD,DB);
  $dbConn->query("SET NAMES 'utf8'");
  $result = mysqli_query($dbConn,"SELECT rid FROM registration WHERE regid = $regid");
    // for each registration, print confirmation (rid)
  if ($result->num_rows >1 ) 
  while ($row = mysqli_fetch_array($result)) {
    echo "<br>確認碼 Confrim #: <a href=\"con_registration.php?rid=" . $row['rid'] . "\">" . $row['rid'] . "</a>";
  }
?>

<?php if ($user_level >=3) { ?>
<br><br><a href="con_newreg.php"><font size=-1>替別人報名<br>(New Registration)</font></a><br><br>
<?php } ?>
<p>

</div>

<div id="thick-col">
現有報名資料 Registration Information

<?php 
//var_dump($_SESSION);
  if (isset($_REQUEST['rid'])) {
  $rid= $_REQUEST['rid'];
  $regid= $_SESSION['regid'];
  }
  $result = mysqli_query($dbConn,"SELECT rid FROM registration WHERE regid = $regid and rid = $rid");
    // for each registration, print confirmation (rid)
    while ($row = mysqli_fetch_array($result)) {
        echo "<div id=thick-col2> <li>報名確認碼 (confirmation no.): " . $row['rid'];
		$_SESSION['rid']=$rid;
        include ("con_reginfo.php");
        echo "</div>";
    }
	$result->close();
	$dbConn->close();
?>
</form>
<center>
    <form name="form1" method="post" action="con_redirect.php">
    <button type="submit" name="submit" value="modifyReg"> 
     <h3>請確認修改註冊</h3> 
Confirm Modification
    </button>
	</center>
    </form>
</div> <!-- end of green box --->

</div> <!-- end of container --->

</body>
</html>